//
//  MoreCommentCell.m
//  TodayComment
//
//  Created by 张吉阳 on 15/10/5.
//  Copyright (c) 2015年 xianrenmoshi. All rights reserved.
//

#import "MoreCommentCell.h"
#import "NewsInfo.h"
#import "FxDownload.h"
@implementation MoreCommentCell



- (void)initCell
{
    [super initCell];
    self.nightBackgroundColor = UIColorFromRGB(0x343434);
     _contentCommentLabel.nightTextColor = [UIColor darkGrayColor];
    RegisterNotify(NofifyNewsIcon, @selector(downloadIcon:));
}


- (void)dealloc
{
    RemoveNofify;
}

- (void)setCellData:(CommentInfo *)commentInfo
{
    [super setCellData:commentInfo];
    _contentCommentLabel.text = commentInfo.commentContent;
    _replyCount.text = commentInfo.commentCount;
    _titleLabel.text = commentInfo.name;
    _imageView.layer.masksToBounds = YES;
    _imageView.layer.cornerRadius = _imageView.frame.size.width/2;
    [[FxDownload download] setNewsIcon:commentInfo imageView:_imageView];
}

- (void)downloadIcon:(NSNotification *)notification
{
    NSDictionary *dict = [notification object];
    CommentInfo *info = [dict objectForKey:@"info"];
    
    if ([info.ID isEqualToString:self.cellInfo.ID]) {
        UIImage *image = [dict objectForKey:@"data"];
        _imageView.image = image;
    }
}

@end
